import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
//定义表格列
export const columns: BasicColumn[] = [
    {
        title: '客户编码',
        dataIndex: 'customerCode',
        width: 170,
        align: 'left',
        resizable: true,
    },
    {
        title: '客户名称',
        dataIndex: 'customerName',
        width: 170,
        align: 'left',
        resizable: true,
    },
    {
        title: '客户等级',
        dataIndex: 'customerLevel',
        width: 130,
        resizable: true,
    },
    {
        title: '客户联系人',
        dataIndex: 'contactName',
        width: 140,
        resizable: true,
    },
    {
        title: '联系人手机号',
        dataIndex: 'contactPhone',
        width: 140,
        resizable: true,
    },
];


//定义新增表单

export const addFormSchema: FormSchema[] = [
    {
        label: '客户编码',
        field: 'customerCode',
        component: 'Input',
        componentProps: { readOnly: true,placeholder: '无需填写，系统自动生成', },
      },
    {
      label: '客户名称',
      field: 'customerName',
      component: 'Input',
      required: true 
    },
    {
        label: '客户等级',
        field: 'customerLevel',
        component: 'JSelectInput',
        componentProps: {
            options: [
              { label: '一批', value: '一批' },
              { label: '二批', value: '二批' },
              { label: '三批', value: '三批' },
            ],
          },
          required: true ,
      },
    {
      label: '客户联系人',
      field: 'contactName',
      component: 'Input',
      required: true ,
    },
    {
        label: '联系人电话',
        field: 'contactPhone',
        component: 'Input',
        rules: [{ required: true, message: '请输入正确的手机号', pattern: /^1[3456789]\d{9}$/ }],
      }
  ];